/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.system;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ciummo
 */
@Entity
@Table(name = "Sessione")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sessione.findAll", query = "SELECT s FROM Sessione s"),
    @NamedQuery(name = "Sessione.findByIdSessione", query = "SELECT s FROM Sessione s WHERE s.idSessione = :idSessione"),
    @NamedQuery(name = "Sessione.findByUsername", query = "SELECT s FROM Sessione s WHERE s.username = :username")})
public class Sessione implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idSessione")
    private String idSessione;
    @Basic(optional = false)
    @Column(name = "username")
    private String username;

    public Sessione() {
    }

    public Sessione(String idSessione) {
        this.idSessione = idSessione;
    }

    public Sessione(String idSessione, String username) {
        this.idSessione = idSessione;
        this.username = username;
    }

    public String getIdSessione() {
        return idSessione;
    }

    public void setIdSessione(String idSessione) {
        this.idSessione = idSessione;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSessione != null ? idSessione.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sessione)) {
            return false;
        }
        Sessione other = (Sessione) object;
        if ((this.idSessione == null && other.idSessione != null) || (this.idSessione != null && !this.idSessione.equals(other.idSessione))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ejb.system.Sessione[ idSessione=" + idSessione + " ]";
    }
    
}
